package com.polukeuro.app.client.events;

import com.google.gwt.event.shared.GwtEvent;
import com.google.gwt.user.client.ui.Widget;

public class CustomErrorEvent extends GwtEvent<CustomErrorHandler> {
	
	private static Type<CustomErrorHandler> TYPE = new Type<CustomErrorHandler>();

	private final Widget widget;
	
	public CustomErrorEvent(Widget widget) {
		this.widget = widget;
	}

	@Override
	protected void dispatch(CustomErrorHandler handler) {
		handler.onError(this);
	}

	@Override
	public com.google.gwt.event.shared.GwtEvent.Type<CustomErrorHandler> getAssociatedType() {
		return TYPE;
	}

	public Widget getWidget() {
		return widget;
	}

	public static Type<CustomErrorHandler> getType() {
		return TYPE;
	}

}
